package com.zyf.lj.mapper;

import com.zyf.lj.entity.News;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface NewsMapper {

    List<News> findAllNews();
    void insertNews(News news);
    News findById(@Param("id") Integer id);
    List<News> findLatestNews(@Param("limit") int limit);
    
    List<News> findNewsByUserId(@Param("userId") Integer userId);
    void updateNews(News news);
    void deleteNews(@Param("id") Integer id, @Param("userId") Integer userId);
} 